<!DOCTYPE html>
<html lang=''>

<head>
    <meta charset='UTF-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script src='./vue.js'></script>
</head>

<body>
    <div id='app'> </div>
</body>
<script>
    const { onBeforeMount, onMounted, onBeforeUpdate, onUpdated } = Vue
    const app = Vue.createApp({

        setup (props, context) {

            onBeforeMount(() => {
                console.log('挂载之前调用');
            })
            onMounted(() => {
                console.log('挂载完成');
            })
            onBeforeUpdate(() => {
                console.log('更新之前');
            })
            onUpdated(() => {
                console.log('更新完成');
            })

            return {}
        },
        mounted () {
            console.log('选项式，挂载完成');
        },
    })
    app.mount('#app')
</script>

</html>